package org.jeecg.entity.car;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.system.entity.BaseEntity;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description: 商户优惠券
 * @Author: liurui
 * @Date:   2020-10-22
 * @Version: V1.0
 */
@Data
@TableName("car_merchant_derate")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="car_merchant_derate对象", description="商户优惠券")
public class CarMerchantDerate extends BaseEntity  {
    
	/**id*/
	@TableId(type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "id")
	private String id;
	/**tenantId*/
    @ApiModelProperty(value = "tenantId")
	private String tenantId;
	/**projectId*/

    @ApiModelProperty(value = "projectId")
	private String projectId;

	@ApiModelProperty(value = "车牌号")
	@Excel(name = "车牌号", width = 15)
	private String  plateNumber;

	@ApiModelProperty(value = "商家余额")
	@Excel(name = "商家余额", width = 15)
	private BigDecimal remainAmount;
	/**赠送余额*/
	@ApiModelProperty(value = "赠送余额")
	private BigDecimal donateAmount;
	/**减免商家*/
    @ApiModelProperty(value = "减免商家")
	private String merchantId;

	@ApiModelProperty(value = "商家名称")
	@Excel(name = "减免商家", width = 15)
	@TableField(exist = false)
	private String merchantName;

	/**优惠券类型：1 系统发放  0 商家自己发放*/
	@Excel(name = "优惠券类型：0普通商家发放  1 系统发放  2系统商家发放", width = 15)
    @ApiModelProperty(value = "优惠券类型：0普通商家发放  1 系统发放  2系统商家发放")
	@Dict(dicCode = "derate_type")
	private Integer derateType;
	/**优惠券规则：1 减免金额*/
	@Excel(name = "优惠券规则：1 减免金额", width = 15)
    @ApiModelProperty(value = "优惠券规则：1 减免金额")
	@Dict(dicCode = "derate_mode")
	private String derateMode;
	/**优惠生成方式：0 余额生成 1 赠送金额生成*/
	@Excel(name = "优惠券生成方式：0 余额生成 1 赠送金额生成", width = 15)
	@ApiModelProperty(value = "优惠券生成方式：0 余额生成 1 赠送金额生成")
	@Dict(dicCode = "derate_source")
	private Integer derateSource;
	/**减免金额*/
	@Excel(name = "减免金额", width = 15)
    @ApiModelProperty(value = "减免金额")
	private BigDecimal derateAmount;
	/**可用次数 默认1*/
	@Excel(name = "可用次数 默认1", width = 15)
    @ApiModelProperty(value = "可用次数 默认1")
	private Integer usableNumber;
	/**已使用次数 默认0 */
	@Excel(name = "已使用次数 默认0 ", width = 15)
    @ApiModelProperty(value = "已使用次数 默认0 ")
	private Integer usedNumber;
	/**状态：0 未使用  1已发送 2 已使用  -1已失效*/
	@Excel(name = "状态：0 未使用  1已发送 2 已使用  -1已失效", width = 15)
    @ApiModelProperty(value = "状态：0 未使用  1已发送 2 已使用  -1已失效")
	@Dict(dicCode = "derate_status")
	private Integer status;
	/**有效期开始时间*/
	@Excel(name = "有效期开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "有效期开始时间")
	private Date startTime;
	/**有效期结束时间*/
	@Excel(name = "有效期结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "有效期结束时间")
	private Date endTime;

	@TableField(exist = false)
	@ApiModelProperty(value = "优惠打折请求地址-生成二维码用")
	private String deratePayUrl;
	/**使用时间*/
	@Excel(name = "使用时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "使用时间")
	private Date useTime;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**修改时间*/
	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "修改时间")
	private Date updateTime;
	/**createBy*/
    @ApiModelProperty(value = "createBy")
	private String createBy;
	/**updateBy*/
    @ApiModelProperty(value = "updateBy")
	private String updateBy;
	/**delFlag*/
    @ApiModelProperty(value = "delFlag")
	@TableLogic
	private String delFlag;
	/**备注*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
	private String remarks;

	/*优惠卷张数*/
	@TableField(exist = false)
	private Integer derateNumber;

	@TableField(exist = false)
	private List<String> merchantIdList;

	@TableField(exist = false)
	private String parkId;

}
